package track;

import io.DbFuncs;

public class SubGenre {

	private int _id;
	private Genre _genre;
	private String _name;
	
	public SubGenre(int id)
	{
		this._id = id;
	}
	
	public SubGenre(int id, Genre genre, String name)
	{
		this(id);
		this._genre = genre;
		this._name = name;
	}
	
	/**
	 * All the get functions
	 * 
	 * @return int
	 */
	public int getId()
	{
		return this._id;
	}
	/**
	 * @return Genre
	 */
	public Genre getGenre()
	{
		if(this._genre == null)
			this._genre = new Genre(DbFuncs.getContentInt("sub_genres", "genre_id", "id", this._id));
		
		return this._genre;
	}
	/**
	 * @return String
	 */
	public String getName()
	{
		if(this._name == null)
			this._name = DbFuncs.getContentString("sub_genres", "name", "id", this._id);
		
		return this._name;
	}
}
